#!/usr/bin/perl

use strict;
use warnings;

use CGI;
use LWP::UserAgent;

my $cgi=new CGI;

my %FormValues;

print "Content-Type: text/html\n\n";

my $url = 'https://reserve.opas.jp/cgi-bin/KGALOGIN?grp=27207&srv=MEMBER&ui=I1I4&er=';

print "<html> <head><LINK REL='stylesheet' HREF='http://www.jp-life.org/wiki.css'> </head> <body> <br>
<blockquote> \n";

print "In the code, three vriables are <b>to be</b> been sent out to the given url in <b>step_2.cgi</b>:<br>
Please click <a href=step_2.cgi >Here</a> to see the results after some values has been post. \n";

print "<li> id</li>\n";
print "<li> pw</li>\n";
print "<li> ipw</li>\n";
print "<li> sent to: ".$url."</li>\n";

print "The info above is from the login page, which is fetech by the code dynamatically. 
</blockquote>
<hr> \n";


if(not $url ){
	print "No action link.<br>"; exit();
}


my $agent=$ENV{'HTTP_USER_AGENT'};

my $ua = LWP::UserAgent->new;
$ua->agent($agent);

my $req = HTTP::Request->new('GET',$url );
my $res = $ua->request($req);
print $res->content, "\n";

